package com.gitee.dolt.core.exception;


import com.gitee.dolt.core.exception.code.ExceptionCode;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * 服务器内部异常
 *
 * @author LYH
 */
@Data
@Accessors(chain = true)
public class InternalServerException extends RuntimeException {


    private int code;
    private String msg;
    private Throwable cause;

    public InternalServerException(String msg) {
        this(msg, (Throwable) null);
    }

    public InternalServerException(String msg, Throwable cause) {
        super(msg);
        this.code = ExceptionCode.INTERNAL_SERVER_ERROR.getCode();
        this.msg = msg;
        this.cause = cause;
    }

    public InternalServerException(Throwable cause) {
        this(ExceptionCode.INTERNAL_SERVER_ERROR.getMsg(), cause);
    }


}
